﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SyringeControl.WinForms
{
    /// <summary>
    /// Generic variant of <see cref="System.EventArgs"/> for easier creating events conforming to .NET guidelines.
    /// Stores a value of <typeparamref name="T"/> in itself as a payload.
    /// </summary>
    /// <typeparam name="T">type of value used as a payload of event</typeparam>
    public class EventArgs<T>: EventArgs
    {
        /// <summary>
        /// Value passed in this object.
        /// </summary>
        public T Value { get; set; }
        
        /// <summary>
        /// Initializes instance of <see cref="EventArgs{T}"/>
        /// </summary>
        /// <param name="value">value to store in object</param>
        public EventArgs(T value)
        {
            Value = value;
        }
    }
}
